Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Allocating Structures


OTFree

Frees memory allocated using the OTAlloc function.

C INTERFACE
OSStatus OTFree(void* ptr, OTStructType structType);
C++ INTERFACE
OSResult TEndpoint::Free(void* ptr, OTStructType structType);
PARAMETERS
ptr
A pointer to the structure to be deallocated. This is the pointer returned by the OTAlloc function.
structType
The name of the structure for which you allocated memory using the OTAlloc function. Possible constant names are given by the structure types enumeration. ( page 3-47)
DESCRIPTION
In order to use the OTFree function, you must not have changed the memory allocated by the OTAlloc function for the structure specified by the structType parameter or for any of the buffers to which it points.

You are responsible for passing a structType parameter that exactly matches the type of structure being freed.

The OTFree function, along with the OTAlloc function, is provided mainly for compatibility with XTI.

VALID STATES
All

SEE ALSO
The OTAlloc function (page 3-92) allocates the memory OTFree deallocates.

You use one of the constant names given by the structure types enumeration (page 3-47) to specify the structure to be freed.

To allocate raw memory, use the OTAllocMem function, and to deallocate the allocated raw memory, use the OTFreeMem function, both described in the chapter "Process Management."


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996